<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Dashboard extends Admin_Controller
{
  private $module = 'dashboard';

  function __construct()
  {
    parent::__construct();
    if ($this->uri->segment(3) != 'login') {
      if (!$this->session->userdata('userInfo')) {
        header('Location: ' . base_url(ADMIN_PATCH . '/users/login'));
        return false;
      }
    }
  }

//  Backend Function
  function index()
  {
    $data = array(
      'module' => $this->module,
      'module_name' => 'Bảng điều khiển'
    );
    $this->twiggy->set($data, NULL, TRUE);
    $this->twiggy->title($data['module_name']);
    $this->twiggy->css('all', 'dashboard.css');
    $this->twiggy->js('script.js');
    $this->twiggy->template('dashboard')->display();
  }
//  Private Function
  function _menu(){
    $this->twiggy->template('menu')->display();
  }

}
